package com.class04.mapper;

import com.class04.pojo.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @ClassDescription:规定数据方法可以
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2023/11/13 8:08
 */
public interface EmployeeMapper {
    //    根据id查询员工信息

    @Select("select * from t_emp where emp_id = #{jfjfj}")
    Employee queryById(Integer id);


    //    通过id删除员工
    @Delete("delete from t_emp where emp_id = #{jfjfj}")
    int deleteById(Integer id);

    //    分页查询数据
    @Update("update t_emp set emp_name = #{empName}," +
            "emp_salary = #{empSalary} where emp_id = #{empId}")
    int updateEmployee(Employee employee);

    @Insert("insert into t_emp (emp_name,emp_salary) values(#{empName},#{empSalary})")
    int addEmployee(Employee employee);

}
